package visao;

import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import javax.swing.JButton;
import java.awt.FlowLayout;
import javax.swing.JTabbedPane;
import javax.swing.JScrollPane;
import javax.swing.BoxLayout;
import javax.swing.JTextArea;
import javax.swing.JLabel;
import java.awt.Font;
import java.awt.Component;
import javax.swing.JTextField;
import java.awt.GridLayout;
import java.awt.Dimension;

public class JanelaConfigurar extends JDialog
{
	private static final long serialVersionUID = 5155277909614819087L;
	private JTextField txtNegacao;
	private JTextField txtConjuno;
	private JTextField txtDisjuncao;
	private JTextField txtImplicacao;
	private JTextField txtEquivalencia;
	
	public JanelaConfigurar(JFrame owner)
	{
		super(owner);
		setTitle("Configuração");
		setModal(true);
		
		JPanel panel_botoes = new JPanel();
		FlowLayout flowLayout = (FlowLayout) panel_botoes.getLayout();
		flowLayout.setAlignment(FlowLayout.TRAILING);
		getContentPane().add(panel_botoes, BorderLayout.SOUTH);
		
		JButton btnOk = new JButton("Ok");
		panel_botoes.add(btnOk);
		
		JButton btnAplicar = new JButton("Aplicar");
		panel_botoes.add(btnAplicar);
		
		JButton btnCancelar = new JButton("Cancelar");
		panel_botoes.add(btnCancelar);
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		getContentPane().add(tabbedPane, BorderLayout.CENTER);
		
		JPanel panel_geral = new JPanel();
		tabbedPane.addTab("Geral", null, panel_geral, null);
		
		JPanel panel_alfa = new JPanel();
		tabbedPane.addTab("Variáveis", null, panel_alfa, null);
		panel_alfa.setLayout(new BoxLayout(panel_alfa, BoxLayout.Y_AXIS));
		
		JLabel lblAsVariveisVlidas = new JLabel("<html>As variáveis válidas como átomos. Devem ser apenas 1 caractere. Colocar separadas por virgula</html>");
		lblAsVariveisVlidas.setAlignmentX(Component.CENTER_ALIGNMENT);
		lblAsVariveisVlidas.setFont(new Font("Dialog", Font.BOLD, 12));
		panel_alfa.add(lblAsVariveisVlidas);
		
		JScrollPane scrollPane = new JScrollPane();
		panel_alfa.add(scrollPane);
		
		JTextArea txtrVariaveis = new JTextArea();
		scrollPane.setViewportView(txtrVariaveis);
		
		JPanel panel_omega = new JPanel();
		tabbedPane.addTab("Operadores", null, panel_omega, null);
		panel_omega.setLayout(new BoxLayout(panel_omega, BoxLayout.Y_AXIS));
		
		JLabel lblOperadores = new JLabel("Operadores");
		lblOperadores.setFont(new Font("Dialog", Font.BOLD, 14));
		panel_omega.add(lblOperadores);
		
		JPanel panel = new JPanel();
		panel_omega.add(panel);
		panel.setLayout(new GridLayout(0, 3, 2, 4));
		
		JLabel lblNegao = new JLabel("Negação");
		panel.add(lblNegao);
		
		txtNegacao = new JTextField();
		panel.add(txtNegacao);
		txtNegacao.setEditable(false);
		txtNegacao.setColumns(10);
		
		JButton btnTrocarNegacao = new JButton("Trocar");
		panel.add(btnTrocarNegacao);
		
		JLabel lblConjuno = new JLabel("Conjunção");
		panel.add(lblConjuno);
		
		txtConjuno = new JTextField();
		txtConjuno.setEditable(false);
		panel.add(txtConjuno);
		txtConjuno.setColumns(10);
		
		JButton btnTrocarConjuncao = new JButton("Trocar");
		panel.add(btnTrocarConjuncao);
		
		JLabel lblDisjuno = new JLabel("Disjunção");
		panel.add(lblDisjuno);
		
		txtDisjuncao = new JTextField();
		txtDisjuncao.setEditable(false);
		panel.add(txtDisjuncao);
		txtDisjuncao.setColumns(10);
		
		JButton btnTrocardisjuncao = new JButton("Trocar");
		panel.add(btnTrocardisjuncao);
		
		JLabel lblImplicao = new JLabel("Implicação");
		panel.add(lblImplicao);
		
		txtImplicacao = new JTextField();
		txtImplicacao.setEditable(false);
		panel.add(txtImplicacao);
		txtImplicacao.setColumns(10);
		
		JButton btnTrocarImplicacao = new JButton("Trocar");
		panel.add(btnTrocarImplicacao);
		
		JLabel lblEquivalncia = new JLabel("Equivalência");
		panel.add(lblEquivalncia);
		
		txtEquivalencia = new JTextField();
		txtEquivalencia.setEditable(false);
		panel.add(txtEquivalencia);
		txtEquivalencia.setColumns(10);
		
		JButton btnTrocarEquivalencia = new JButton("Trocar");
		panel.add(btnTrocarEquivalencia);
		
	}

}
